package com.archermind.boc.xml.xstream;

import java.util.HashMap;

import com.archermind.boc.domain.BaseDomain;
import com.archermind.boc.domain.Message;
import com.archermind.boc.xml.converter.HashMapConverter;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

public class MessageXStream extends XStream {
	public MessageXStream() {
		super(new DomDriver());
		registerConverter(new HashMapConverter());
		omitField(BaseDomain.class, "sessionID");
		alias("message", Message.class);
		alias("x", HashMap.class);
		alias("str", String.class);
		useAttributeFor(Message.class, "id");
		useAttributeFor(Message.class, "to");
		useAttributeFor(Message.class, "from");
		useAttributeFor(Message.class, "type");
	}
}
